<template>
  <div class="index_page">
    <YHeader :active="'index'"></YHeader>
    <ClassBlock :height="366"></ClassBlock>
    <div class="i_content" v-for="(item, index) in zoneData" :key="index">
      <div class="i_zone">
        <div class="zone_header">
          <div class="big_text">
            <span class="col_block"></span>
            {{ item.zone }}
            <router-link :to="{path:'/CourseCenterBody'}"><el-link :underline="false" type="info" class="fr small_text link_text">更多课程></el-link></router-link>
          </div>
        </div>
        <div class="zone_body">
          <ul class="clearfix course_list">
            <li v-for="(that, int) in item.zoneCourse" :key="int">
              <router-link :to="{path:'/curriculumcenter',query:{kid:JSON.stringify(that.kid)}}">
                <div class="img_box">
                  <img :src="that.courseImage" alt="">
                </div>
                <p>{{ that.courseName }}</p>
                <span class="price_box">
                  ￥{{that.coursePrice.toFixed(2)}}
                  <span class="font_12 padl_10" v-if="openVip && that.courseVprice != that.coursePrice">
                    SVIP:{{that.courseVprice ? '￥' + that.courseVprice.toFixed(2) : '免费'}}
                  </span>
                </span>

              </router-link>
            </li>

          </ul>
        </div>
      </div>
    </div>
    <y-footer></y-footer>
    <right-top></right-top>
  </div>
</template>

<script>
  import YHeader from './header'
  import ClassBlock from "./ClassBlock";
  import YFooter from "./Bottom";
  import rightTop from "./rightTop";
  export default {
    components:
      {
        YHeader,
        ClassBlock,
        YFooter,
        rightTop
      },
    methods:{
      kCheng(){
        this.$axios.get('education-system/sys/zonecourse/getAllZonecourse').then(r=>{
          this.zoneData=r.data.obj;
          //alert("1")
          // alert(JSON.stringify(r.data))
        })
      }
    },
    created(){
      this.kCheng();
      //alert("2")
    },
    data() {
      return {
        zoneData:[],
        openVip: true
      }
    }
  }
</script>

<style lang="scss" rel="stylesheet/scss">
  .index_page {
    .clearfix:before, .clearfix:after {
      content: "";
      display: table;
    }
    .clearfix:after {
      clear: both;
    }
    .i_content {
      background: rgb(245, 245, 245);
      &:nth-child(2n) {
        background: rgb(228, 228, 228);
      }
      .i_zone {
        width: 1200px;
        margin: 0 auto;
        padding: 50px 0 40px 0;
      }
    }
    .zone_header {
      .col_block {
        display: inline-block;
        width: 4px;
        height: 24px;
        background: #333;
        position: relative;
        top: 4px;
      }
      .big_text {
        // text-align: center;
        font-size: 24px;
      }
      .fr {
        float: right;
      }
      .small_text {
        // text-align: center;
        font-size: 14px;
        color: #999;
        margin-top: 10px;
      }
      .link_text:hover {
        text-decoration: none;
        color: #333;
      }
    }
    .zone_body {
      margin-top: 25px;
    }
    .course_list {
      li {
        list-style-type:none;
        float: left;
        width: 285px;
        height: 204px;
        border-radius: 6px;
        margin: 0px 20px 20px 0px;
        &:nth-child(4n) {
          margin-right: 0px;
        }
        &:hover {
          box-shadow: 0px 3px 18px rgba(0, 0, 0, 0.2);
          transform: translateY(-2px);
          transition: all .3s;
        }
        a {
          display: block;
          width: 100%;
          height: 100%;
          position: relative;
          background: #fff;
          border-radius: 6px;
          .img_box {
            width: 285px;
            height: 140px;
            position: relative;
            .qizi {
              position: absolute;
              top: 0;
              left: 10px;
              width: 46px;
              height: 46px;
              color: #fff;
              font-size: 14px;
              text-align: center;
            }
            img {
              width: 285px;
              height: 140px;
              border-radius: 6px 6px 0 0;
            }
            .live_time {
              position: absolute;
              bottom: 0;
              left: 0;
              font-size: 12px;
              line-height: 16px;
              width: 285px;
              background: rgba(0, 0, 0, 0.2);
              color: #fff;
              padding-bottom: 2px;
            }
          }
          &:hover {
            color: #000;
            text-decoration: none;
          }
          p {
            font-size: 16px;
            margin-top: 5px;
            padding-left: 10px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            word-break: break-all;
          }
          .price_box {
            font-size: 16px;
            position: absolute;
            bottom: 10px;
            left: 10px;
            color: red;
          }
        }
      }
    }
    .test_list{
      .test_option{
        float: left;
        width: 520px;
        padding: 18px 25px;
        margin-right: 55px;
        margin-bottom: 20px;
        border-radius: 8px;
        font-size: 14px;
        background-color: #fff;
        &.right_0 {
          margin-right: 0px;
        }
      }
      .iconfont{
        margin-right: 6px;
      }
    }
  }
</style>
